package com.soft.javase.day02.practice.order;

/**
 * @author yzg
 * @desc TODO
 * @date 2025/4/16
 */
public class Order {
    private long orderNumber;
    private User owner;
    private Goods[] goods;

    public Order(long orderNumber, User owner, Goods[] goods) {
        this.orderNumber = orderNumber;
        this.owner = owner;
        this.goods = goods;
    }

    // 查看商品详情信息
    public void viewGoodsDetails() {
        System.out.println("====== 订单号: " + orderNumber + " 的商品详情 ======");
        System.out.println("所属用户: " + owner.getName());
        for (Goods item : goods) {
            item.displayInfo();
            System.out.println("----------------------");
        }
    }

    public long getOrderNumber() { return orderNumber; }
    public User getOwner() { return owner; }
    public Goods[] getGoods() { return goods; }

}
